import pandas as pd
from pandas import NA


def delete_none(frame):
    # dropna()
    # frame.dropna(inplace=True)  # 默认删除带有缺失值的行
    # frame.dropna(axis=1, inplace=True)  # 通过指定删除带有缺失值的列
    # frame.dropna(axis=1, inplace=True, how="all")  # 删除所有都是缺失值的列
    frame.dropna(thresh=2, inplace=True)  # 非缺失值小于thresh就会别删除
    print(frame)


if __name__ == '__main__':
    data = {
        "name": ["小红", "小蓝", "小绿"],
        "age": [18, 19, 20],
        "height": [165, 175, 185],
        "framework": ["python", "java", NA]
    }
    frame = pd.DataFrame(data)
    delete_none(frame)
